home *** CD-ROM | disk | FTP | other *** search
-
-
-
- LD User Commands LD
-
-
-
- NNAAMMEE
- ld - link editor
-
- SSYYNNOOPPSSIISS
- lldd [ --aalliiggnn _d_a_t_u_m ] [ --AA _n_a_m_e ] [ --dd ] [ --DD _h_e_x ]
- [ --ee _e_n_t_r_y ] [ --ll_x ] [ --LL_d_i_r ] [ --MM ] [ --nn ]
- [ --NN ] [ --oo _n_a_m_e ] [ --rr ] [ --ss ] [ --SS ] [ --tt ]
- [ --TT[tteexxtt]_h_e_x ] [ --TTddaattaa _h_e_x ] [ --uu _n_a_m_e ]
- [ --xx ] [ --XX ] [ --yy_s_y_m ] [ --zz ] _f_i_l_e_n_a_m_e...
-
- DDEESSCCRRIIPPTTIIOONN
- _l_d combines several object programs into one, resolves
- external references, and searches libraries. In the sim-
- plest case several object _f_i_l_e_n_a_m_es are given, and _l_d com-
- bines them, producing an object module which can either be
- executed or become the input for a subsequent _l_d run. In
- the latter case, the --rr option must be given to preserve the
- relocation bits. The output of _l_d is left on a file called
- _a.._o_u_t if not otherwise specified. The output file is made
- executable only if no errors occurred during link editing.
-
- Files specified by the argument _f_i_l_e_n_a_m_e ... are con-
- catenated in the order specified. The entry point of the
- output is the beginning of the first routine, unless the --ee
- option is specified.
-
- If a named file is a library, it is searched exactly once at
- the point it is encountered in the argument list. Only
- those routines defining an unresolved external reference are
- loaded. If a routine from a library references another rou-
- tine in the same library, and the library has not been pro-
- cessed by _r_a_n_l_i_b, the referenced routine must appear after
- the referencing routine in the library. Thus the order of
- programs within libraries may be important. The first
- member of a library should be a file named `__.SYMDEF',
- which is understood to be a dictionary for the library as
- produced by _r_a_n_l_i_b; the dictionary is searched iteratively
- to satisfy as many references as possible.
-
- The symbols __eetteexxtt, __eeddaattaa and __eenndd (eetteexxtt, eeddaattaa and eenndd in
- C) are reserved, and if referred to, are set to the first
- location above the program, the first location above ini-
- tialized data, and the first location above all data,
- respectively. It is erroneous to define these symbols.
-
- OOPPTTIIOONNSS
- Options should appear before the _f_i_l_e_n_a_m_e_s, except abbrevi-
- ated library names specified by the --ll option, which can
- appear anywhere.
-
- --aalliiggnn _d_a_t_u_m
- _d_a_t_u_m (usually a FORTRAN common block) is increased in
-
-
-
- Sprite v1.0 17 July 1986 1
-
-
-
-
-
-
- LD User Commands LD
-
-
-
- length to be a multiple of the page size; its beginning
- is set at a page boundary.
-
- --AA _n_a_m_e
- Incremental loading: linking is to be done in a manner
- so that the resulting object may be read into an
- already executing program. _n_a_m_e is the name of a file
- whose symbol table is taken as a basis on which to
- define additional symbols. Only newly linked material
- is entered into the text and data portions of _a.._o_u_t,
- but the new symbol table will reflect all symbols
- defined before and after the incremental load. This
- argument must appear before any other object file in
- the argument list. One or both of the --TT options may
- be used as well, and will be taken to mean that the
- newly linked segment will commence at the corresponding
- addresses (which must be a multiple of the page size).
- The default value is the old value of __eenndd.
-
- --dd Force definition of common storage even if the --rr flag
- is present.
-
- --DD _h_e_x
- Pad the data segment with zero-valued bytes to make it
- _h_e_x bytes long.
-
- --ee _e_n_t_r_y
- Define the eentry point: the _e_n_t_r_y argument is made the
- name of the entry point of the loaded program.
-
- --ll_x This option is an abbreviation for the library name
- lliibb_x..aa, where _x is a string. _l_d searches for libraries
- first in any directories specified with --LL options,
- then in the standard directory //sspprriittee//lliibb//_t_m..mmdd, where
- _t_m is the target machine on which the linked program is
- intended to execute. _T_m defaults to the value of the
- MMAACCHHIINNEE environment variable, but may be overridden
- with the --mm switch. A library is searched when its
- name is encountered, so the placement of a --ll is signi-
- ficant.
-
- --LL_d_i_r
- Add _d_i_r to the list of directories in which libraries
- are searched for. Directories specified with --LL are
- searched before the standard directory.
-
- --mm_t_m Use _t_m as the target machine for this link, rather than
- the MMAACCHHIINNEE environment variable. This switch deter-
- mines where the linker looks for libraries (see the --ll
- switch above).
-
- --MM Produce a primitive load map, listing the names of the
-
-
-
- Sprite v1.0 17 July 1986 2
-
-
-
-
-
-
- LD User Commands LD
-
-
-
- files which will be loaded.
-
- --nn Arrange (by giving the output file a 0410 `magic
- number') that when the output file is executed, the
- text portion will be read-only and shared among all
- processes executing the file. This involves moving the
- data areas up to the first possible segment boundary
- following the end of the text.
-
- --NN Do not make the text portion read-only or sharable.
- (Use `magic number' 0407.)
-
- --oo _n_a_m_e
- _N_a_m_e is made the name of the _l_d output file, instead of
- aa..oouutt.
-
- --rr Generate relocation bits in the output file so that it
- can be the subject of another _l_d run. This flag also
- prevents final definitions from being given to common
- symbols, and suppresses the `undefined symbol' diagnos-
- tics.
-
- --ss Strip the output, that is, remove the symbol table and
- relocation bits to save space (but impair the useful-
- ness of the debuggers). This information can also be
- removed by _s_t_r_i_p(1).
-
- --SS Strip the output by removing all symbols except locals
- and globals.
-
- --tt Trace: display the name of each file as it is pro-
- cessed.
-
- --TT[tteexxtt]_h_e_x
- Start the text segment at location _h_e_x. Specifying --TT
- is the same as using the --TTtteexxtt option.
-
- --TTddaattaa _h_e_x
- Start the data segment at location _h_e_x. This option is
- only of use to programmers wishing to write code for
- PROMs, since the resulting code cannot be executed by
- the UNIX system.
-
- --uu _n_a_m_e
- Enter _n_a_m_e as an uundefined symbol. This is useful for
- loading wholly from a library, since initially the sym-
- bol table is empty and an unresolved reference is
- needed to force the loading of the first routine.
-
- --xx Preserve only global (non-..gglloobbll) symbols in the output
- symbol table; only enter external symbols. This option
- saves some space in the output file.
-
-
-
- Sprite v1.0 17 July 1986 3
-
-
-
-
-
-
- LD User Commands LD
-
-
-
- --XX Record local symbols, except for those whose names
- begin with `L'. This option is used by _c_c to discard
- internally generated labels while retaining symbols
- local to routines.
-
- --yy_s_y_m
- Display each file in which _s_y_m appears, its type and
- whether the file defines or references it. Many such
- options may be given to trace many symbols. It is usu-
- ally necessary to begin _s_y_m with an `_', as external C,
- FORTRAN and Pascal variables begin with underscores.
-
- --zz Arrange for the process to be loaded on demand from the
- resulting executable file (0413 `magic number') rather
- than preloaded. This is the default. Results in a
- (32-byte) header on the output file followed by text
- and data segments, each of which has a multiple of
- page-size bytes (being padded out with nulls in the
- file if necessary). With this format the first few BSS
- segment symbols may actually end up in the data seg-
- ment; this is to avoid wasting the space resulting from
- rounding the data segment size. The text is read-only
- and shared among all processes executing the file.
-
- FFIILLEESS
- /lib/lib*.a libraries
- /usr/lib/lib*.a more libraries
- /usr/local/lib/lib*.a still more libraries
- a.out output file
-
- SSEEEE AALLSSOO
- as(1), ar(1), cc(1V), ranlib(1), strip(1)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 17 July 1986 4
-
-
-
-